/**
 * http://usejsdoc.org/
 */
var _req,_res,
	fs = require('fs'),
	url = require('url');

module.exports = function(){
	var _res = arguments[0];
	var _req = arguments[1];
	
	this.checkSession = function(model){
		if(model === 'login'){
			return true;
		}else if(global.sessionLib.username && global.sessionLib.username !== ""){
			return true;
		}
		return false;
	};
	
	this.login = function(){
		lib.httpParam.POST('username',function(value){
			global.sessionLib.username = value;
			if(value === 'devintam'){
				_res.render(VIEW + 'live.jade',{'user':value});
			}else{
				_res.render(VIEW + 'main.jade',{'user':value});
			}
		});
	};
};